<template>
  <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
    <el-tab-pane label="配置式" name="1">
      <RevConfig v-if="activeName === '1'" />
    </el-tab-pane>
    <el-tab-pane label="关系图" name="2">
      <TestGraph v-if="activeName === '2'" />
    </el-tab-pane>
  </el-tabs>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import type { TabsPaneContext } from 'element-plus'
import RevConfig from './RevConfig.vue'
import TestGraph from './TestGraph.vue'

const activeName = ref('2')

const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event)
}
</script>

<style lang="less">
.demo-tabs.el-tabs {
  height: 100%;
  display: flex;
  flex-direction: column;
  .el-tabs__header {
    margin-bottom: 0;
    .el-tabs__nav-scroll {
      padding: 0 10px;
    }
  }
  .el-tabs__content {
    flex: 1;
    padding: 10px;
    color: #6b778c;
    font-size: 32px;
    font-weight: 600;
  }
  .el-tab-pane {
    height: 100%;
  }
}
</style>
